Skip to content

Conversation

@shsms
Copy link
Contributor

@shsms shsms commented Jul 8, 2025

The string representation of a receiver is used in logging, and
without this, it is impossible to identify which receiver is meant,
from looking at the logs.

shsms added 2 commits July 8, 2025 14:19
The string representation of a receiver is used in logging, and
without this, it is impossible to identify which receiver is meant,
from looking at the logs.

Signed-off-by: Sahas Subramanian <[email protected]>
Signed-off-by: Sahas Subramanian <[email protected]>
Copilot AI review requested due to automatic review settings July 8, 2025 12:24
@shsms shsms requested a review from a team as a code owner July 8, 2025 12:24
@github-actions github-actions bot added part:docs Affects the documentation part:channels Affects channels implementation labels Jul 8, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances logging by including each receiver's name in its string representation and documents this change.

  • Updated __str__ to append the receiver’s _name.
  • Added a release note entry for the new behavior.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/frequenz/channels/_broadcast.py Modified __str__ to include self._name
RELEASE_NOTES.md Documented that __str__ now includes the name
Comments suppressed due to low confidence (3)

src/frequenz/channels/_broadcast.py:518

  • Add or update unit tests to verify that __str__ includes the receiver's name as expected, ensuring this behavior is covered.
        return f"{self._channel}:{type(self).__name__}:{self._name}"

src/frequenz/channels/_broadcast.py:520

  • [nitpick] Consider updating __repr__ to also include the receiver’s name for consistency and improved debugging output.
    def __repr__(self) -> str:

RELEASE_NOTES.md:19

  • Remove the leading extra hyphen and blank line so this bullet renders correctly (e.g., use - The ... without a preceding blank -).
- The `__str__` representation of broadcast receivers now include the receiver's name.

@shsms shsms added this pull request to the merge queue Jul 8, 2025
Merged via the queue into frequenz-floss:v1.x.x with commit 0970c72 Jul 8, 2025
5 checks passed
@shsms shsms deleted the show-recv-name branch July 8, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:channels Affects channels implementation part:docs Affects the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants